第 8 步:很好!现在让我们向用户询问星星的颜色。

input()是控制台的ask()版本,它请求用户输入,并将其存储为string 。

  • 在,拖动get_user_input()内缩进的Input Text 。
  • 更改"What is your name?"到"What color should the stars be?" .
  • 然后,将=符号左侧的变量从my_var为color 。

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)